﻿<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {

    }
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
    <title>帐号产品规格列表</title>
    <script type="text/javascript" src="/Scripts/Commen.js"></script>
    <script type="text/javascript" src="/Scripts/BD_Product/BD_ProdCate_Index.js"></script>
</head>
<body>
    <script type="text/javascript" src="/Scripts/ExtTimeOut.js"></script>
    <script type="text/javascript" src="/Scripts/ExtRequiredFieldPluins.js"></script>
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <!--列表数据源-->
    <ext:Store ID="ProdCateListStore" IDMode="Explicit" runat="server" RemoteSort="true"
        SkipIdForNewRecords="false" UseIdConfirmation="false" SerializationMode="Complex">
        <Proxy>
            <ext:HttpProxy Url="/ProdCategory/ProdCategoryListPaging" />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="FID" Root="data" TotalProperty="total">
                <Fields>
                    <ext:RecordField Name="FID" />
                    <ext:RecordField Name="FName" />
                    <ext:RecordField Name="FReMark" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="limit" Value="15" Mode="Raw" />
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="fName" Value="#{InputQ_FName}.getValue()" Mode="Raw" />
            <ext:Parameter Name="fRemark" Value="#{InputQ_FRemark}.getValue()" Mode="Raw" />
        </BaseParams>
    </ext:Store>
    <!--编辑数据源-->
    <ext:Hidden ID="FIdH" IDMode="Explicit" runat="server" Text="" AutoDataBind="true" />
    <ext:Store ID="PordCateEidtStore" runat="server" AutoLoad="false">
        <Proxy>
            <ext:HttpProxy Url="/ProdCategory/GetProdCategoryById/" />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="FID" Root="data" TotalProperty="total">
                <Fields>
                    <ext:RecordField Name="FID" />
                    <ext:RecordField Name="FName" />
                    <ext:RecordField Name="FReMark" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="fId" Value="#{FIdH}.getValue()" Mode="Raw" />
        </BaseParams>
        <Listeners>
            <BeforeLoad Handler="#{EditFormPanel}.el.mask('正在加载信息...', 'x-mask-loading');" />
            <LoadException Handler="#{EditFormPanel}.el.unmask();" />
            <Load Fn="BD_ProdCate.Mgr.formStoreLoaded" />
        </Listeners>
    </ext:Store>
    <ext:Viewport ID="ProdCateViewport" runat="server" Layout="BorderLayout">
        <Items>
            <ext:FormPanel ID="EditFormPanel" runat="server" Title="产品规格编辑" Region="North" Split="true"
                Height="120" Collapsible="true" Layout="HBoxLayout" Padding="5" AnchorHorizontal="100%"
                LabelWidth="30" Url="/ProdCategory/SaveProdCategory/">
                <TopBar>
                    <ext:Toolbar ID="TopBar" runat="server">
                        <Items>
                            <ext:ToolbarFill runat="server">
                            </ext:ToolbarFill>
                            <ext:Button ID="Button2" runat="server" Text="新增" Icon="Add">
                                <Listeners>
                                    <Click Handler="#{EditFormPanel}.form.reset();#{FIdH}.setValue(null);" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button1" runat="server" Text="保存" Icon="Disk">
                                <Listeners>
                                    <Click Handler="#{EditFormPanel}.form.submit({waitMsg:'正在保存...', params:{fId:#{FIdH}.getValue()},success:BD_ProdCate.Mgr.successHandler , failure:BD_ProdCate.Mgr.failureHandler});" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:FieldSet ID="ProdCateFieldSet" runat="server" CheckboxToggle="false" Collapsed="false" Border="false" Width="600"
                        LabelWidth="40" Layout="FormLayout" LabelAlign="Right">
                        <Items>
                            <ext:Container ID="Container1" runat="server" Layout="HBoxLayout" Height="30">
                                <Items>
                                    <ext:TextField ID="TextField1" Name="fName" DataIndex="FName" runat="server" FieldLabel="规格"
                                        AllowBlank="false" BlankText="规格不能为空" />
                                    <ext:TextField ID="TextField3" Name="fRemark" DataIndex="FReMark" runat="server"
                                        FieldLabel="备注" AllowBlank="true" LabelWidth="80" />
                                </Items>
                            </ext:Container>
                        </Items>
                    </ext:FieldSet>
                </Items>
            </ext:FormPanel>
            <ext:FormPanel ID="SearchFormPanel" runat="server" Title="筛选条件" Region="West" Width="250"
                Split="true" Collapsible="true" Layout="FormLayout" Padding="5" LabelWidth="50">
                <Items>
                    <ext:TextField ID="InputQ_FName" runat="server" FieldLabel="规格" AnchorHorizontal="100%" />
                    <ext:TextField ID="InputQ_FRemark" runat="server" FieldLabel="备注" AnchorHorizontal="100%" />
                </Items>
                <Buttons>
                    <ext:Button ID="Button5" runat="server" Text="搜索" Icon="Accept">
                        <Listeners>
                            <Click Fn="BD_ProdCate.Mgr.searchList" />
                        </Listeners>
                    </ext:Button>
                    <ext:Button ID="Button6" runat="server" Text="清空" Icon="Cancel">
                        <Listeners>
                            <Click Fn="BD_ProdCate.Mgr.resetSearchFrom" />
                        </Listeners>
                    </ext:Button>
                </Buttons>
            </ext:FormPanel>
            <ext:Panel ID="Panel3" runat="server" Region="Center" Layout="AccordionLayout" Split="true"
                Header="false">
                <Items>
                    <ext:GridPanel ID="ProdCateGrid" runat="server" Border="false" StoreID="ProdCateListStore"
                        StripeRows="true" TrackMouseOver="true" ClicksToEdit="0" Region="Center">
                        <ColumnModel ID="ColumnModel1" runat="server">
                            <Columns>
                                <ext:Column ColumnID="FName" DataIndex="FName" Header="规格">
                                </ext:Column>
                                <ext:Column ColumnID="FReMark" DataIndex="FReMark" Header="备注">
                                </ext:Column>
                                <ext:CommandColumn Width="80" Hideable="false">
                                    <Commands>
                                        <ext:GridCommand CommandName="Edit" Icon="ApplicationFormEdit" Text="修改">
                                        </ext:GridCommand>
                                    </Commands>
                                </ext:CommandColumn>
                                
                                <ext:CommandColumn Width="60" Hideable="false">
                                    <Commands>
                                        <ext:GridCommand CommandName="Delete" Icon="Cross" Text="删除">
                                        </ext:GridCommand>
                                    </Commands>
                                </ext:CommandColumn>
                                
                            </Columns>
                        </ColumnModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolbar1" runat="server" StoreID="ProdCateListStore"
                                PageSize="15" />
                        </BottomBar>
                        <Listeners>
                            <Command Fn="BD_ProdCate.Mgr.commandHandler" />
                        </Listeners>
                        <LoadMask ShowMask="true" />
                        <SelectionModel>
                            <ext:RowSelectionModel>
                            </ext:RowSelectionModel>
                        </SelectionModel>
                    </ext:GridPanel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
</body>
</html>
